package pl.edu.agh.mguesser.game.answer;

/**
 * @author keiran
 */
public enum Answer {

    GUESSED {
        @Override
        public int getScore(int second) {
            if(second < 0) {
                throw new IllegalArgumentException();
            }
            
            return Math.max(second <= 6 
                                ? 5
                                : 5 + (6 - second),
                            0);
        }
    }, 
    HALF_GUESSED {
        @Override
        public int getScore(int second) {
            if(second < 0) {
                throw new IllegalArgumentException();
            }
            
            return Math.max(second <= 6 
                                ? 2
                                : 2 + ((6 - second) / 2),
                            0);
        }
    },
    MISSED {
        @Override
        public int getScore(int second) {
            if(second < 0) {
                throw new IllegalArgumentException();
            }
            
            return -5;
        } 
    };

    public abstract int getScore(int second);
    
}
